package zuoye23.zuoye6;

public class Pet {
//    6：用oop描述宠物系统，宠物有 狗，猫和鹦鹉。
//    宠物都有名字，品种，体重的属性，有吃和睡 和自我介绍的方法。。。
//    狗还有抓老鼠的方法，猫有爬树的方法，鹦鹉有飞行的方法。
//    用继承描述这个现象
    private String name;
    private  String variety;
    private double weight;

    public Pet(String name, String variety, double weight) {
        this.name = name;
        this.variety = variety;
        this.weight = weight;
    }

    public Pet() {

    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getVariety() {
        return variety;
    }

    public void setVariety(String variety) {
        this.variety = variety;
    }

    public double getWeight() {
        return weight;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }

    public String eat(){
        return "我会吃个桃桃好凉凉";
    }
    public String sleep(){
        return "我喜欢睡觉觉";
    }
    public String selfIntroduce(){
        return "我是"+name+",我的品种是"+variety+",体重是"+weight+"公斤";
    }
}
